//---------------------------------------------------------------------------

#ifndef GlassesFirmDlgH
#define GlassesFirmDlgH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>

#include "GlassesBridge.h"
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <ComCtrls.hpp>
#include <ToolWin.hpp>

//---------------------------------------------------------------------------
class TfrmGlassesFirmDlg : public TForm
{
__published:	// IDE-managed Components
        TPanel *pnlMain;
        TPanel *Panel1;
        TToolBar *barMain;
        TToolButton *btnUpdate;
        TToolButton *btnAdd;
        TToolButton *btnDelete;
        TStringGrid *grdModels;
        TLabel *lblFirm;
        TEdit *edtFirm;
        TBitBtn *btnOk;
        TBitBtn *btnHelp;
        TBitBtn *btnCancel;
        TLabel *lblAddress;
        TEdit *edtAddress;
        TLabel *lblPhone;
        TEdit *edtPhone;
        void __fastcall btnOKClick(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
        void __fastcall btnUpdateClick(TObject *Sender);
        void __fastcall btnAddClick(TObject *Sender);
        void __fastcall FormShow(TObject *Sender);
        void __fastcall btnDeleteClick(TObject *Sender);
        void __fastcall grdModelsKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
private:	// User declarations
        TGlassesBridge * bridge;
        bool isUpdate;
        __int64 firmID;
        TGlassesFirm * firm;
        TStringList * models;
        void RefreshGrid();
        void SetButtonsState();
public:		// User declarations
        __fastcall TfrmGlassesFirmDlg(TComponent* Owner, TGlassesBridge * bridge);
        __fastcall TfrmGlassesFirmDlg(TComponent* Owner, TGlassesBridge * bridge, __int64 id, AnsiString name, AnsiString address, AnsiString phone);
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmGlassesFirmDlg *frmGlassesFirmDlg;
//---------------------------------------------------------------------------
#endif
